<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\MasterHomeService;

class MasterHome extends Api
{
    protected $noNeedLogin = ['banner','page','operation'];
    protected $noNeedRight = '*';

    /**
     * 轮播图
     *
     */
    public function banner()
    {
        $res = MasterHomeService::getBanner();
        return json($res);
    }

    /**
     * 轮播图
     *
     */
    public function page()
    {
        $data = $this->request->post();
        $res = MasterHomeService::getPage($data);
        return json($res);
    }

    /**
     * 实名认证
     *
     */
    public function realname()
    {
        $data = $this->request->post();
        $res = MasterHomeService::putRealname($data);
        return json($res);
    }

    /**
     * 运营中心列表
     *
     */
    public function operation()
    {
        $data = $this->request->post();
        $res = MasterHomeService::getOperation($data);
        return json($res);
    }

    // 运营电话
    public function phone()
    {
        $res = MasterHomeService::getPhone();
        return json($res);
    }

    // 我要签约
    public function sign()
    {
        $data = $this->request->post();
        $res = MasterHomeService::putSign($data);
        return json($res);
    }
    
    // 更新经纬度
    public function update_location()
    {
        $data = $this->request->post();
        $res = MasterHomeService::updateLocation($data);
        return json($res);
    }
}